package cc.linker.steplink.crm.service;

import cc.linker.steplink.crm.domain.RobotDynamicPo;

import java.util.List;
import java.util.Map;

/**
 * @author snake
 * @date 2019/8/27
 **/
public interface IClientRobotService {

    List<Map<String, Object>> articlelist(Map<String, Object> map) throws Exception;

    Integer addRobotArticle(Map<String, Object> map) throws Exception;

    Integer delRobotArticle(Map<String, Object> map) throws Exception;

    List<Map<String, Object>> getUserArticleInfo();

    String getArticleLabelByOrgIdAndType(String orgId, String type);

    String getLastPushTimeByOpenIdAndToken(String openId, String token);

    /**
     * 获取用户推送文章范围=营销文章库-用户已经推送的文章
     *
     * @param openid
     * @param token
     * @return
     */
    List<Map<String, Object>> getUserPushArticle(String openid, String token);

    List<String> getArticleIdByLabel(String oneLabelId, String orgId);

    List<String> getPushArticleId(String openid, String token);

    /**
     * 根据文章id获取文章
     *
     * @param oneArticleId
     * @param orgId
     * @return
     */
    Map<String, String> getOneArticle(String oneArticleId, String orgId);


    /**
     * 添加维护数据
     *
     * @param map
     * @return
     * @throws Exception
     */
    Integer addRobotStatistics(Map<String, Object> map) throws Exception;

    /**
     * 获取有机器人的机构合集
     *
     * @return
     * @throws Exception
     */
    List<Map<String, String>> getOrgIds() throws Exception;

    /**
     * 获取维护人数 （粉丝总数）
     *
     * @param orgId
     * @return
     * @throws Exception
     */
    Integer getMaintainNum(String orgId) throws Exception;

    /**
     * 按天获取阅读时长
     *
     * @param orgId
     * @param
     * @return
     * @throws Exception
     */
    Integer getReadTime(String orgId, String startTime,String endTime) throws Exception;

    /**
     * 按天獲取訂單數量
     *
     * @param orgId
     * @param maintainNum
     * @param
     * @return
     * @throws Exception
     */
    Integer getTranRate(String orgId, String startTime,String endTime) throws Exception;


    /**
     * 按天获取触达人数
     * @param orgId
     * @param startTime
     * @param endTime
     * @return
     * @throws Exception
     */
    Integer getTouchNum(String orgId, String startTime,String endTime) throws Exception;



    /**
     * 按天获取新增关注粉丝数量
     *
     * @param orgId
     * @param
     * @return
     * @throws Exception
     */
    Integer getFollowNum(String orgId, String startTime,String endTime) throws Exception;

    /**
     * 按天获取取消关注粉丝数量
     *
     * @param orgId
     * @param
     * @return
     * @throws Exception
     */
    Integer getUnfollowNum(String orgId, String startTime,String endTime) throws Exception;

    /**
     * 获取活跃度
     *
     * @param orgId
     * @return
     * @throws Exception
     */
    String getActivity(String orgId) throws Exception;

    Integer getMaintainTimes(String orgId, String type) throws Exception;

    List<RobotDynamicPo> getRobotDynamicList(Map<String, Object> param);

    /**
     * 获取活跃粉丝数
     *
     * @param orgId
     * @return
     * @throws Exception
     */
    Integer getActiveFans(String orgId) throws Exception;

    Integer getMaintainPerson(String orgId, String type) throws Exception;

    Integer getOrderCount(String orgId) throws Exception;

    Integer adjustmentTimes(String orgId, String type) throws Exception;

    Map<String,Object> maintainBlock(Map<String, String> param) throws Exception;

    List<Map<String,Object>> robotChart(Map<String, String> param) throws Exception;
}
